//依赖模块
const fs = require("fs");

//读取文件a
function readFileA() {
    return new Promise((resolve,reject)=>{
        fs.readFile("./test/a.txt", (err, data) => {
            if(err) reject(err);
            if(data) resolve(data.toString());
        });
    });
}

//读取文件b
function readFileB() {
    return new Promise((resolve,reject)=>{
        fs.readFile("./test/b.txt", (err, data) => {
            if(err) reject(err);
            if(data) resolve(data.toString());
        });
    });
}

//读取文件c
function readFileC() {
    return new Promise((resolve,reject)=>{
        fs.readFile("./test/c.txt", (err, data) => {
            if(err) reject(err);
            if(data) resolve(data.toString());
        });
    });
}

async function main(){
    let fileA=await readFileA();
    console.log(fileA);

    let fileB=await readFileB();
    console.log(fileB);

    let fileC=await readFileC();
    console.log(fileC);
}

main();